package com.dd2086.activemqTest;

import org.springframework.jms.annotation.JmsListener;  
import org.springframework.messaging.handler.annotation.SendTo;  
import org.springframework.stereotype.Component;  
  
@Component  
public class Consumer2 {  
  
    @JmsListener(destination = "sample.queue")  
    @SendTo("out.queue")  //实现双向消息，返回到producer 厉害
    public String receiveQueue(String text) {  
        System.out.println("Consumer2收到的报文为:"+text);  
        return "return message"+text;  
    }
    
}  